package com.cs.study.homework._0229;

public class Demo4 {
    public static void main(String[] args) {
        String s = "woaijavawozhenaijavawozhendeaijavawozhendehenaijavaxinbuxinwoaijavagun";
        int count = 0;
        int fromIndex = 0;
        while ((fromIndex = s.indexOf("java",fromIndex))!=-1){
            count++;
            fromIndex++;
        }
        System.out.println(count);
    }
}
